<?php
/**
* @version $Id: mod_dirlister.php 1 2006-10-25 14:01:19Z elkuku $
* @package 
* @copyright 
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
*/

// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );

$showmode 	= $params->get( 'showmode', 0 );
$dir01 = $params->get( 'dir01', '' );
echo '<hr />' . $dir01 . '<hr />';
$output 	= '';

$sPfad = '/' . $dir01 . '/';
$Pfad = './'. $dir01 . '/';
$DD = dir($Pfad);

while (false !== ($entry = $DD->read()))
{
     if($entry != '.' && $entry != '..')
     {
          echo '<a href="'.$mosConfig_live_site.$sPfad . $entry . '">'.$entry.'</a><br />';
     } 
}

$DD->close();
echo '<hr />';

function dirTree($dir)
{
   $d = dir($dir);
   while (false !== ($entry = $d->read()))
	{
       if($entry != '.' && $entry != '..' && is_dir($dir.$entry))
       {
		     $arDir[$entry] = dirTree($dir.$entry.'/');
		 }
   }
   $d->close();
   return $arDir;
}

function printTree($array, $level=0)
{
   foreach($array as $key => $value)
	{
       echo "<div class='dir' style='width: ".($level*20)."px;'>&nbsp;</div>".$key."<br/>\n";
       if(is_array($value))
		 {
           printTree($value, $level+1);
		 }
   }
}
?>
